<?php

class Bonus {
  var $empresa;
	var $servico;
	var $inicio;
	var $bonus;
	var $fim;
	var $status;
	
  function listar(){
      $bonuss = array();
      $select = "SELECT * FROM empresaxservicoxbonus WHERE '".date('Y-m-d')."' BETWEEN dt_inicio_vigencia AND dt_fim_vigencia";
      $result = mysql_query($select);
      while($row = mysql_fetch_array($result)){
        $bonus = new Bonus();
        $bonus->empresa = $row['cd_empresa'];
        $bonus->servico = $row['de_servico'];
        $bonus->inicio = $row['dt_inicio_vigencia'];
        $bonus->bonus = $row['qt_bonus'];
        $bonus->fim = $row['dt_fim_vigencia'];
        $bonus->status = $row['st_servico'];
        $bonuss[] = $bonus;
      }
      return $bonuss;
  }	
}

?>
